import 'package:flutter/material.dart';

class ButtonWidget extends StatelessWidget {
  const ButtonWidget({
    super.key,
    this.onTap,
    this.child,
    this.width = 400,
    this.height = 59,
    this.margin = const EdgeInsets.fromLTRB(42, 0, 42, 0),
    this.borderRadius = 15,
    this.gradient = const LinearGradient(colors: [
      Color(0xFFA5D400),
      Color(0xFF8DFD89),
      Color(0xFF0BD1C7),
    ]),
  });
  final GestureTapCallback? onTap;
  final Widget? child;
  final double width;
  final double height;
  final EdgeInsetsGeometry margin;
  final double borderRadius;
  final LinearGradient gradient;
  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: () => {
        if (onTap != null) {onTap!()}
      },
      child: Container(
        margin: margin,
        height: height,
        width: width,
        alignment: Alignment.center,
        decoration: BoxDecoration(
          borderRadius: BorderRadius.circular(borderRadius),
          gradient: gradient,
        ),
        child: child,
      ),
    );
  }
}
